package com.tengju.bff.interfaces.covercharge.controller.admin;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.idanchuang.component.base.JsonResult;
import com.tengju.bff.interfaces.covercharge.entity.vo.AdminFrozenDetailQueryVo;
import com.tengju.bff.interfaces.covercharge.service.IServiceFrozenDetailService;
import com.tengju.bff.interfaces.shared.ApiResponse;
import com.tengju.bff.interfaces.shared.servlet.ManageEntrance;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 *
 * @author fwy
 */
@Api(value = "frozenDetail", tags = "服务费冻结记录查询")
@RestController
@Slf4j
@RequestMapping("/manage/bill/frozenDetail")
@ManageEntrance
public class AdminFrozenDetailController {

    @Autowired
    IServiceFrozenDetailService serviceFrozenDetailService;

    @GetMapping
    @ApiOperation(value = "服务费冻结记录查询", notes = "服务费冻结记录查询")
    public ApiResponse<IPage<AdminFrozenDetailQueryVo>> query(String codeId,
                                                             @RequestParam(defaultValue = "0", name = "pageNo", required = true) Integer pageNo,
                                                             @RequestParam(defaultValue = "10", name = "limit", required = true)Integer limit,
                                                             String startDate,
                                                             String endDate){
        return ApiResponse.newSuccess(serviceFrozenDetailService.queryPageByIdCode(new Page<>(pageNo, limit),codeId,startDate,endDate));
    }

}
